import axios from '@/utils/axios'

/****
 * gh dm
 */

/*
 * 菜单管理模块
 */

// 删除
export const batchDelete = data => {
    return axios({
        url: '/menu/delete',
        method: 'post',
        data
    })
}

// 查找导航菜单树table
export const findMenuTree = () => {
    return axios({
        url: '/menu/findMenuTree',
        method: 'get'
    })
}

//  拉取列表接口
export const fetchMenuTree = params => {
    return axios({
        url: '/sys/getResList',
        method: 'get',
        params,
        mock: true
    })
}
//  编辑
export const editRes = data => {
    return axios({
        url: '/sys/res/editRes',
        method: 'post',
        data,
        mock: true
    })
}
// 菜单新增
export const addRes = data => {
    return axios({
        url: '/sys/res/addRes',
        method: 'post',
        data,
        mock: true
    })
}

// del
export const delRes = params => {
    return axios({
        url: '/sys/res/delRes',
        method: 'post',
        params,
        mock: true
    })
}

//
export const getParentResList = params => {
    return axios({
        url: '/sys/resManager/getParentResList.json',
        method: 'get',
        params
    })
}

// 左侧api管理list
export const getMenuApiList = params => {
    return axios({
        url: '/sys/res/getApiResList',
        method: 'get',
        params,
        mock: true
    })
}

// 按钮的权限集合
export const getButtonList = params => {
    return axios({
        url: '/sys/res/getButtonList',
        method: 'get',
        params,
        mock: true
    })
}

// 排序接口
export const getMenuSort = params => {
    return axios({
        url: '/sys/res/sortRes',
        method: 'post',
        data: params,
        mock: true
    })
}
